﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Brio
{
    public class ChromosomeListItem
    {
        public ChromosomeListItem(string directoryPath)
        {
            DirectoryPath = directoryPath;

            // Store Sheet Music Directory Path
            SheetMusicDirectoryPath = Directory.Exists(DirectoryPath + "/Sheet Music/") ? DirectoryPath + "/Sheet Music/" : "";

            // Set Midi File Path
            string[] MidiFiles = Directory.GetFiles(directoryPath, "*.mid");

            string[] TextFiles = Directory.GetFiles(directoryPath, "*.txt");

            MIDIPath = MidiFiles.Length > 0 ? MidiFiles[0] : "";

            MetricPath = TextFiles.Length > 0 ? TextFiles[0] : "";

            if (!string.IsNullOrWhiteSpace(MetricPath))
            {
                MetricPath = MetricPath.Replace("/", "\\");
            }
        }

        public string DirectoryPath
        { get; set; }

        public string SheetMusicDirectoryPath
        { get; set; }

        public string MIDIPath
        { get; set; }

        public string MetricPath
        { get; set; }

    }
}
